/**
 * Created by wuchen on 2017/7/6.
 */

import send from './http'

const QUERY_TASK = 'app.callSheet.queryExportMonitorTask'
const REMOVE_TASK = 'app.callSheet.removeExportMonitorTask'
const ADD_TASK = 'app.callSheet.addExportMonitorTask'
export default {

  /**
   * 查询导出任务
   * @param {Object} postData
   * @param {String} [postData.BEGIN_TIME] 起始时间 //"2016-12-01 00:00:00"
   * @param {String} [postData.END_TIME] 结束时间 //"2016-12-01 00:00:00"
   * @param {String} [postData.pageSize] 页码 //"2"
   * @param {String} [postData.page] 每页条数 //10
   */
  queryExportMonitorTask (postData) {
  let req = {
    data: postData,
    action: QUERY_TASK
  }
  return send.fetch(req, 'post')
},

/**取消导出任务
 *data:"7f189410-75bf-11e7-9aa0-6793b43a71c4"
 *  @param {String} [data] ,需要取消的导出任务的id
 */
removeExportMonitorTask (postData) {
  let req = {
    data: postData,
    action: REMOVE_TASK
  }
  return send.fetch(req, 'post')
},
/**提交导出任务
 *data:"{"_id":{"$in":["2b844252-d4c0-4d42-a261-cf991559fe52"]}}"
 *  @param {String[]} [data.$in] ,需要导出的通话记录id数组
 */
addExportMonitorTask (postData) {
  let req = {
    data: postData,
    action: ADD_TASK
  }
  return send.fetch(req, 'get')
}

}
